package com.edu.test;
/*
 * @Author:princess
 * @Date 2023/10/31 10 31 18:58
 *
 */

import com.edu.interceptor.LogInterceptor;
import com.edu.service.impl.StudentServiceImpl;
import org.springframework.cglib.proxy.Enhancer;

/*
    动态代理之CGlib
 */
public class MyTest4 {
    public static void main(String[] args) {
        StudentServiceImpl student = new StudentServiceImpl();
        StudentServiceImpl s = (StudentServiceImpl)Enhancer.create(student.getClass(), new LogInterceptor(student));
        s.addStudent();
        s.deleteStudent();
        s.updateStudent();
        s.selectStudent();
    }
}
